//结缘-- 双方结缘、数据共享。不污染其他情缘
let mongoose = require("mongoose");
mongoose.connect("mongodb://localhost:27017/newQY", {
    useNewUrlParser: true,
    useUnifiedTopology: true
}).then(() => {
    console.log("集合连接成功！");
}).catch(() => {
    console.log("集合连接失败！");
})
let schema = mongoose.Schema;
let lovelist = new schema({
    //用户1
    user: {
        type: String,
        required: true
    },
    userName: {
        type: String,
        required: true
    },
    //用户2
    toUser: {
        type: String,
        required: true
    },
    toUserName: {
        type: String,
        required: true,
        default: "未知"
    },
    //承诺
    promise: {
        type: String,
        required: true
    },
    //建立时间
    createTime: {
        type: String,
        required: true
    },
    // 结缘状态 1 发起结缘 2考虑中 3接受 4拒绝 5撤回
    status: {
        type: Number,
        required: true,
        default: 1
    },
    //亲密度 后期规划
    intimacy: {
        type: Number,
        required: true,
        default: 0
    },
})
let love = mongoose.model("lovelists", lovelist)
module.exports = {
    love
}